package com.ternnetwork.wechat.service.impl.tag;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.ternnetwork.commons.utils.JsonUtils;
import com.ternnetwork.configuration.service.system.SystemParameterService;
import com.ternnetwork.wechat.model.tag.WechatTagResponse;
import com.ternnetwork.wechat.service.tag.WechatTagService;
import com.ternnetwork.wechat.util.WechatQyTag;


@Service("wechatTagService")
public class WechatTagServiceImpl implements WechatTagService {
	@Resource
	private SystemParameterService systemParameterService;
	
	
	public  String listQyTag(){
		String corpId=systemParameterService.getValueByKey("WECHAT_QY_CORP_ID");
		String corpSecret=systemParameterService.getValueByKey("WECHAT_QY_CORP_SECRET");
		return WechatQyTag.list(corpId, corpSecret);
	}
	
	
	public WechatTagResponse listQyTagObject(){
		String json=listQyTag();
		WechatTagResponse retVal=JsonUtils.jsonToObject(json,WechatTagResponse.class);
		return retVal;
	}
	
}
